package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.MeetingSystem;
import com.ruoyi.system.mapper.MeetingSystemMapper;
import com.ruoyi.system.service.IMeetingSystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 参加会议用户 服务层实现
 * 
 * @author ruoyi
 * @date 2019-03-17
 */
@Service
public class MeetingSystemServiceImpl implements IMeetingSystemService 
{
	@Autowired
	private MeetingSystemMapper meetingSystemMapper;

	/**
     * 查询参加会议用户信息
     * 
     * @param msId 参加会议用户ID
     * @return 参加会议用户信息
     */
    @Override
	public MeetingSystem selectMeetingSystemById(Long msId)
	{
	    return meetingSystemMapper.selectMeetingSystemById(msId);
	}
	
	/**
 * 查询参加会议用户列表
 *
 * @param meetingSystem 参加会议用户信息
 * @return 参加会议用户集合
 */
@Override
public List<MeetingSystem> selectMeetingSystemList(MeetingSystem meetingSystem)
{
	return meetingSystemMapper.selectMeetingSystemList(meetingSystem);
}

	/**
	 * 查询手机 用户
	 *
	 * @param meetingSystem 参加会议用户信息
	 * @return 参加会议用户集合
	 */
	@Override
	public MeetingSystem selectMeeting(MeetingSystem meetingSystem)
	{
		return meetingSystemMapper.selectMeeting(meetingSystem);
	}

	/**
	 * 查询手机 用户
	 *
	 * @param meetingSystem 参加会议用户信息
	 * @return 参加会议用户集合
	 */
	@Override
	public MeetingSystem selectshouji(String phone)
	{
		return meetingSystemMapper.selectshouji(phone);
	}


	/**
	 * 查询队名 的列表
	 *
	 * @param meetingSystem
	 * @return
	 */

	@Override
	public List<MeetingSystem> selectdui(MeetingSystem meetingSystem)
	{
		return meetingSystemMapper.selectdui(meetingSystem);
	}


	/**
	 * 查询队名 的列表
	 *
	 * @param meetingSystem
	 * @return
	 */

	@Override
	public List<MeetingSystem> selectgeren(MeetingSystem meetingSystem)
	{
		return meetingSystemMapper.selectgeren(meetingSystem);
	}


	/**
	 * 查询队名 的列表
	 *
	 * @param meetingSystem
	 * @return
	 */

	@Override
	public MeetingSystem selectduiwu(String duiname)
	{
		return meetingSystemMapper.selectduiwu(duiname);
	}

    /**
     * 新增参加会议用户
     * 
     * @param meetingSystem 参加会议用户信息
     * @return 结果
     */
	@Override
	public int insertMeetingSystem(MeetingSystem meetingSystem, HttpServletRequest request)
	{
		int row = 0;
	      row =	meetingSystemMapper.insertMeetingSystem(meetingSystem);
		     request.getSession().setAttribute("user",meetingSystem);
		System.out.println(request.getSession().getAttribute("user"));
		return row;
	}
	
	/**
     * 修改参加会议用户
     * 
     * @param meetingSystem 参加会议用户信息
     * @return 结果
     */
	@Override
	public int updateMeetingSystem(MeetingSystem meetingSystem)
	{
	    return meetingSystemMapper.updateMeetingSystem(meetingSystem);
	}

	/**
	 * 删除参加会议用户对象
	 *
	 * @param ids 需要删除的数据ID
	 * @return 结果
	 */
	@Override
	public int deleteMeetingSystemByIds(String ids)
	{
		return meetingSystemMapper.deleteMeetingSystemByIds(Convert.toStrArray(ids));
	}


	/**
	 * 删除全部参加会议用户对象
	 *
	 * @param ids 需要删除的数据ID
	 * @return 结果
	 */
	@Override
	public int quanshan()
	{
		return meetingSystemMapper.shanquan();
	}


}
